#undef  xuser
#define xuser mixc::math_tan::inc
#include<math.h>
#include"configure/lookup_table.hpp"
#include"define/nan.hpp"
#include"macro/xalign.hpp"
#include"math/abs.hpp"
#include"math/literal.hpp"
#include"math/tan.hpp"
#include"utils/mfxx.hpp"

namespace mixc::math_tan::inc{
    using namespace literal;
}

namespace mixc::math_tan::origin{
    /*
    #include"define/base_type.hpp"
    #include<math.h>
    #include<stdio.h>

    void gen(uxx step, uxx items_per_line){
        uxx p                   = items_per_line;

        for(uxx i = 0; i < step; i++){
            p                  *= items_per_line;
        }

        for(uxx i = step; i--; ){
            p                  /= items_per_line;
            printf("{ ");

            for(uxx j = 0; j < items_per_line; j++){
                f80 origin      = f80(j) / p;
                f80 value       = ::tan(origin);
                printf("%+.18Le, ", value);
            }
            printf("}, \n");
        }

        printf("{ ");

        for(uxx j = items_per_line; j < items_per_line * 2; j++){
            f80 origin      = f80(j) / p;
            f80 value       = ::tan(origin);
            printf("%+.18Le, ", value);
        }
        printf("}, \n");
    }
    
    */
    #if xuse_math_tan_lut4x256
    constexpr xalign(4096) f64 lut[][256] = {
        { +0.000000000000000000e+00, +2.328306436538696289e-10, +4.656612873077392579e-10, +6.984919309616088868e-10, +9.313225746154785159e-10, +1.164153218269348145e-09, +1.396983861923217774e-09, +1.629814505577087404e-09, +1.862645149230957033e-09, +2.095475792884826663e-09, +2.328306436538696293e-09, +2.561137080192565924e-09, +2.793967723846435554e-09, +3.026798367500305185e-09, +3.259629011154174816e-09, +3.492459654808044448e-09, +3.725290298461914080e-09, +3.958120942115783712e-09, +4.190951585769653345e-09, +4.423782229423522978e-09, +4.656612873077392612e-09, +4.889443516731262246e-09, +5.122274160385131881e-09, +5.355104804039001516e-09, +5.587935447692871152e-09, +5.820766091346740788e-09, +6.053596735000610425e-09, +6.286427378654480063e-09, +6.519258022308349702e-09, +6.752088665962219341e-09, +6.984919309616088981e-09, +7.217749953269958621e-09, +7.450580596923828263e-09, +7.683411240577697905e-09, +7.916241884231567548e-09, +8.149072527885437192e-09, +8.381903171539306837e-09, +8.614733815193176483e-09, +8.847564458847046129e-09, +9.080395102500915777e-09, +9.313225746154785425e-09, +9.546056389808655075e-09, +9.778887033462524726e-09, +1.001171767711639438e-08, +1.024454832077026403e-08, +1.047737896442413368e-08, +1.071020960807800334e-08, +1.094304025173187300e-08, +1.117587089538574265e-08, +1.140870153903961231e-08, +1.164153218269348197e-08, +1.187436282634735163e-08, +1.210719347000122129e-08, +1.234002411365509096e-08, +1.257285475730896062e-08, +1.280568540096283029e-08, +1.303851604461669996e-08, +1.327134668827056963e-08, +1.350417733192443930e-08, +1.373700797557830897e-08, +1.396983861923217864e-08, +1.420266926288604832e-08, +1.443549990653991799e-08, +1.466833055019378767e-08, +1.490116119384765735e-08, +1.513399183750152703e-08, +1.536682248115539672e-08, +1.559965312480926640e-08, +1.583248376846313609e-08, +1.606531441211700578e-08, +1.629814505577087547e-08, +1.653097569942474516e-08, +1.676380634307861485e-08, +1.699663698673248455e-08, +1.722946763038635424e-08, +1.746229827404022394e-08, +1.769512891769409364e-08, +1.792795956134796335e-08, +1.816079020500183305e-08, +1.839362084865570276e-08, +1.862645149230957247e-08, +1.885928213596344218e-08, +1.909211277961731189e-08, +1.932494342327118160e-08, +1.955777406692505132e-08, +1.979060471057892104e-08, +2.002343535423279076e-08, +2.025626599788666049e-08, +2.048909664154053021e-08, +2.072192728519439994e-08, +2.095475792884826967e-08, +2.118758857250213940e-08, +2.142041921615600914e-08, +2.165324985980987887e-08, +2.188608050346374861e-08, +2.211891114711761835e-08, +2.235174179077148810e-08, +2.258457243442535784e-08, +2.281740307807922759e-08, +2.305023372173309734e-08, +2.328306436538696710e-08, +2.351589500904083685e-08, +2.374872565269470661e-08, +2.398155629634857638e-08, +2.421438694000244614e-08, +2.444721758365631591e-08, +2.468004822731018568e-08, +2.491287887096405545e-08, +2.514570951461792522e-08, +2.537854015827179500e-08, +2.561137080192566478e-08, +2.584420144557953456e-08, +2.607703208923340435e-08, +2.630986273288727414e-08, +2.654269337654114393e-08, +2.677552402019501372e-08, +2.700835466384888352e-08, +2.724118530750275332e-08, +2.747401595115662312e-08, +2.770684659481049293e-08, +2.793967723846436274e-08, +2.817250788211823255e-08, +2.840533852577210237e-08, +2.863816916942597218e-08, +2.887099981307984201e-08, +2.910383045673371183e-08, +2.933666110038758166e-08, +2.956949174404145149e-08, +2.980232238769532132e-08, +3.003515303134919116e-08, +3.026798367500306100e-08, +3.050081431865693084e-08, +3.073364496231080069e-08, +3.096647560596467054e-08, +3.119930624961854040e-08, +3.143213689327241026e-08, +3.166496753692628011e-08, +3.189779818058014998e-08, +3.213062882423401985e-08, +3.236345946788788972e-08, +3.259629011154175959e-08, +3.282912075519562947e-08, +3.306195139884949935e-08, +3.329478204250336924e-08, +3.352761268615723913e-08, +3.376044332981110902e-08, +3.399327397346497891e-08, +3.422610461711884881e-08, +3.445893526077271872e-08, +3.469176590442658862e-08, +3.492459654808045854e-08, +3.515742719173432845e-08, +3.539025783538819837e-08, +3.562308847904206829e-08, +3.585591912269593822e-08, +3.608874976634980815e-08, +3.632158041000367808e-08, +3.655441105365754802e-08, +3.678724169731141796e-08, +3.702007234096528791e-08, +3.725290298461915786e-08, +3.748573362827302781e-08, +3.771856427192689777e-08, +3.795139491558076773e-08, +3.818422555923463770e-08, +3.841705620288850767e-08, +3.864988684654237764e-08, +3.888271749019624762e-08, +3.911554813385011761e-08, +3.934837877750398759e-08, +3.958120942115785758e-08, +3.981404006481172758e-08, +4.004687070846559758e-08, +4.027970135211946759e-08, +4.051253199577333759e-08, +4.074536263942720761e-08, +4.097819328308107763e-08, +4.121102392673494765e-08, +4.144385457038881767e-08, +4.167668521404268770e-08, +4.190951585769655774e-08, +4.214234650135042778e-08, +4.237517714500429783e-08, +4.260800778865816787e-08, +4.284083843231203793e-08, +4.307366907596590799e-08, +4.330649971961977805e-08, +4.353933036327364812e-08, +4.377216100692751819e-08, +4.400499165058138827e-08, +4.423782229423525835e-08, +4.447065293788912844e-08, +4.470348358154299853e-08, +4.493631422519686863e-08, +4.516914486885073873e-08, +4.540197551250460883e-08, +4.563480615615847894e-08, +4.586763679981234906e-08, +4.610046744346621918e-08, +4.633329808712008931e-08, +4.656612873077395944e-08, +4.679895937442782958e-08, +4.703179001808169972e-08, +4.726462066173556986e-08, +4.749745130538944001e-08, +4.773028194904331017e-08, +4.796311259269718034e-08, +4.819594323635105050e-08, +4.842877388000492067e-08, +4.866160452365879085e-08, +4.889443516731266104e-08, +4.912726581096653122e-08, +4.936009645462040141e-08, +4.959292709827427161e-08, +4.982575774192814182e-08, +5.005858838558201203e-08, +5.029141902923588224e-08, +5.052424967288975246e-08, +5.075708031654362269e-08, +5.098991096019749292e-08, +5.122274160385136316e-08, +5.145557224750523340e-08, +5.168840289115910365e-08, +5.192123353481297390e-08, +5.215406417846684416e-08, +5.238689482212071443e-08, +5.261972546577458470e-08, +5.285255610942845498e-08, +5.308538675308232526e-08, +5.331821739673619555e-08, +5.355104804039006584e-08, +5.378387868404393614e-08, +5.401670932769780644e-08, +5.424953997135167675e-08, +5.448237061500554707e-08, +5.471520125865941739e-08, +5.494803190231328772e-08, +5.518086254596715806e-08, +5.541369318962102840e-08, +5.564652383327489875e-08, +5.587935447692876910e-08, +5.611218512058263946e-08, +5.634501576423650982e-08, +5.657784640789038019e-08, +5.681067705154425057e-08, +5.704350769519812096e-08, +5.727633833885199134e-08, +5.750916898250586174e-08, +5.774199962615973214e-08, +5.797483026981360255e-08, +5.820766091346747296e-08, +5.844049155712134339e-08, +5.867332220077521381e-08, +5.890615284442908425e-08, +5.913898348808295469e-08, +5.937181413173682513e-08, }, 
        { +0.000000000000000000e+00, +5.960464477539069559e-08, +1.192092895507818147e-07, +1.788139343261737808e-07, +2.384185791015670175e-07, +2.980232238769619483e-07, +3.576278686523589966e-07, +4.172325134277585860e-07, +4.768371582031611401e-07, +5.364418029785670823e-07, +5.960464477539768361e-07, +6.556510925293908251e-07, +7.152557373048094727e-07, +7.748603820802332026e-07, +8.344650268556624382e-07, +8.940696716310976030e-07, +9.536743164065391206e-07, +1.013278961181987414e-06, +1.072883605957442908e-06, +1.132488250732906025e-06, +1.192092895508377189e-06, +1.251697540283856823e-06, +1.311302185059345351e-06, +1.370906829834843196e-06, +1.430511474610350782e-06, +1.490116119385868533e-06, +1.549720764161396871e-06, +1.609325408936936221e-06, +1.668930053712487006e-06, +1.728534698488049649e-06, +1.788139343263624574e-06, +1.847743988039212205e-06, +1.907348632814812965e-06, +1.966953277590427277e-06, +2.026557922366055565e-06, +2.086162567141698253e-06, +2.145767211917355764e-06, +2.205371856693028522e-06, +2.264976501468716949e-06, +2.324581146244421471e-06, +2.384185791020142509e-06, +2.443790435795880488e-06, +2.503395080571635831e-06, +2.562999725347408962e-06, +2.622604370123200305e-06, +2.682209014899010281e-06, +2.741813659674839317e-06, +2.801418304450687834e-06, +2.861022949226556256e-06, +2.920627594002445007e-06, +2.980232238778354510e-06, +3.039836883554285189e-06, +3.099441528330237467e-06, +3.159046173106211769e-06, +3.218650817882208516e-06, +3.278255462658228134e-06, +3.337860107434271045e-06, +3.397464752210337673e-06, +3.457069396986428441e-06, +3.516674041762543773e-06, +3.576278686538684093e-06, +3.635883331314849824e-06, +3.695487976091041389e-06, +3.755092620867259212e-06, +3.814697265643503717e-06, +3.874301910419775327e-06, +3.933906555196074465e-06, +3.993511199972401556e-06, +4.053115844748757022e-06, +4.112720489525141287e-06, +4.172325134301554775e-06, +4.231929779077997909e-06, +4.291534423854471113e-06, +4.351139068630974810e-06, +4.410743713407509423e-06, +4.470348358184075377e-06, +4.529953002960673095e-06, +4.589557647737302999e-06, +4.649162292513965515e-06, +4.708766937290661065e-06, +4.768371582067390072e-06, +4.827976226844152961e-06, +4.887580871620950155e-06, +4.947185516397782077e-06, +5.006790161174649151e-06, +5.066394805951551801e-06, +5.125999450728490449e-06, +5.185604095505465520e-06, +5.245208740282477437e-06, +5.304813385059526622e-06, +5.364418029836613502e-06, +5.424022674613738497e-06, +5.483627319390902032e-06, +5.543231964168104532e-06, +5.602836608945346418e-06, +5.662441253722628114e-06, +5.722045898499950045e-06, +5.781650543277312634e-06, +5.841255188054716303e-06, +5.900859832832161477e-06, +5.960464477609648579e-06, +6.020069122387178033e-06, +6.079673767164750262e-06, +6.139278411942365689e-06, +6.198883056720024739e-06, +6.258487701497727835e-06, +6.318092346275475400e-06, +6.377696991053267857e-06, +6.437301635831105631e-06, +6.496906280608989144e-06, +6.556510925386918821e-06, +6.616115570164895085e-06, +6.675720214942918359e-06, +6.735324859720989066e-06, +6.794929504499107632e-06, +6.854534149277274478e-06, +6.914138794055490028e-06, +6.973743438833754707e-06, +7.033348083612068937e-06, +7.092952728390433141e-06, +7.152557373168847744e-06, +7.212162017947313170e-06, +7.271766662725829840e-06, +7.331371307504398180e-06, +7.390975952283018612e-06, +7.450580597061691560e-06, +7.510185241840417448e-06, +7.569789886619196699e-06, +7.629394531398029737e-06, +7.688999176176916984e-06, +7.748603820955858865e-06, +7.808208465734855804e-06, +7.867813110513908223e-06, +7.927417755293016546e-06, +7.987022400072181197e-06, +8.046627044851402599e-06, +8.106231689630681176e-06, +8.165836334410017351e-06, +8.225440979189411548e-06, +8.285045623968864189e-06, +8.344650268748375701e-06, +8.404254913527946504e-06, +8.463859558307577023e-06, +8.523464203087267681e-06, +8.583068847867018902e-06, +8.642673492646831110e-06, +8.702278137426704728e-06, +8.761882782206640178e-06, +8.821487426986637886e-06, +8.881092071766698275e-06, +8.940696716546821766e-06, +9.000301361327008786e-06, +9.059906006107259757e-06, +9.119510650887575102e-06, +9.179115295667955245e-06, +9.238719940448400610e-06, +9.298324585228911619e-06, +9.357929230009488698e-06, +9.417533874790132268e-06, +9.477138519570842754e-06, +9.536743164351620579e-06, +9.596347809132466167e-06, +9.655952453913379941e-06, +9.715557098694362324e-06, +9.775161743475413742e-06, +9.834766388256534615e-06, +9.894371033037725368e-06, +9.953975677818986426e-06, +1.001358032260031821e-05, +1.007318496738172115e-05, +1.013278961216319566e-05, +1.019239425694474216e-05, +1.025199890172636109e-05, +1.031160354650805287e-05, +1.037120819128981791e-05, +1.043081283607165664e-05, +1.049041748085356949e-05, +1.055002212563555688e-05, +1.060962677041761923e-05, +1.066923141519975697e-05, +1.072883605998197051e-05, +1.078844070476426029e-05, +1.084804534954662673e-05, +1.090764999432907024e-05, +1.096725463911159126e-05, +1.102685928389419021e-05, +1.108646392867686750e-05, +1.114606857345962357e-05, +1.120567321824245884e-05, +1.126527786302537373e-05, +1.132488250780836867e-05, +1.138448715259144407e-05, +1.144409179737460036e-05, +1.150369644215783797e-05, +1.156330108694115732e-05, +1.162290573172455883e-05, +1.168251037650804292e-05, +1.174211502129161003e-05, +1.180171966607526056e-05, +1.186132431085899496e-05, +1.192092895564281363e-05, +1.198053360042671701e-05, +1.204013824521070551e-05, +1.209974288999477957e-05, +1.215934753477893959e-05, +1.221895217956318602e-05, +1.227855682434751926e-05, +1.233816146913193975e-05, +1.239776611391644791e-05, +1.245737075870104416e-05, +1.251697540348572893e-05, +1.257658004827050263e-05, +1.263618469305536570e-05, +1.269578933784031855e-05, +1.275539398262536160e-05, +1.281499862741049530e-05, +1.287460327219572005e-05, +1.293420791698103627e-05, +1.299381256176644440e-05, +1.305341720655194486e-05, +1.311302185133753807e-05, +1.317262649612322445e-05, +1.323223114090900443e-05, +1.329183578569487843e-05, +1.335144043048084687e-05, +1.341104507526691018e-05, +1.347064972005306878e-05, +1.353025436483932310e-05, +1.358985900962567355e-05, +1.364946365441212057e-05, +1.370906829919866457e-05, +1.376867294398530598e-05, +1.382827758877204523e-05, +1.388788223355888273e-05, +1.394748687834581890e-05, +1.400709152313285418e-05, +1.406669616791998899e-05, +1.412630081270722375e-05, +1.418590545749455888e-05, +1.424551010228199481e-05, +1.430511474706953196e-05, +1.436471939185717075e-05, +1.442432403664491161e-05, +1.448392868143275496e-05, +1.454353332622070122e-05, +1.460313797100875083e-05, +1.466274261579690419e-05, +1.472234726058516174e-05, +1.478195190537352390e-05, +1.484155655016199109e-05, +1.490116119495056373e-05, +1.496076583973924226e-05, +1.502037048452802709e-05, +1.507997512931691864e-05, +1.513957977410591734e-05, +1.519918441889502362e-05, }, 
        { +0.000000000000000000e+00, +1.525878906368423789e-05, +3.051757813447390315e-05, +4.577636721947442314e-05, +6.103515632579122526e-05, +7.629394546052973696e-05, +9.155273463079538573e-05, +1.068115238436935991e-04, +1.220703131063298048e-04, +1.373291024258094305e-04, +1.525878918092379040e-04, +1.678466812637206533e-04, +1.831054707963631064e-04, +1.983642604142706917e-04, +2.136230501245488375e-04, +2.288818399343029724e-04, +2.441406298506385251e-04, +2.593994198806609246e-04, +2.746582100314756000e-04, +2.899170003101879807e-04, +3.051757907239034964e-04, +3.204345812797275769e-04, +3.356933719847656524e-04, +3.509521628461231532e-04, +3.662109538709055101e-04, +3.814697450662181542e-04, +3.967285364391665166e-04, +4.119873279968560292e-04, +4.272461197463921238e-04, +4.425049116948802329e-04, +4.577637038494257893e-04, +4.730224962171342259e-04, +4.882812888051109764e-04, +5.035400816204614746e-04, +5.187988746702911549e-04, +5.340576679617054522e-04, +5.493164615018098016e-04, +5.645752552977096388e-04, +5.798340493565104000e-04, +5.950928436853175218e-04, +6.103516382912364415e-04, +6.256104331813725968e-04, +6.408692283628314257e-04, +6.561280238427183671e-04, +6.713868196281388604e-04, +6.866456157261983453e-04, +7.019044121440022624e-04, +7.171632088886560527e-04, +7.324220059672651578e-04, +7.476808033869350202e-04, +7.629396011547710825e-04, +7.781983992778787886e-04, +7.934571977633635826e-04, +8.087159966183309094e-04, +8.239747958498862145e-04, +8.392335954651349445e-04, +8.544923954711825461e-04, +8.697511958751344671e-04, +8.850099966840961562e-04, +9.002687979051730624e-04, +9.155275995454706358e-04, +9.307864016120943272e-04, +9.460452041121495880e-04, +9.613040070527418710e-04, +9.765628104409766290e-04, +9.918216142839593162e-04, +1.007080418588795388e-03, +1.022339223362590299e-03, +1.037598028612449506e-03, +1.052856834345478468e-03, +1.068115640568782642e-03, +1.083374447289467488e-03, +1.098633254514638465e-03, +1.113892062251401036e-03, +1.129150870506860662e-03, +1.144409679288122807e-03, +1.159668488602292933e-03, +1.174927298456476508e-03, +1.190186108857778996e-03, +1.205444919813305865e-03, +1.220703731330162583e-03, +1.235962543415454619e-03, +1.251221356076287443e-03, +1.266480169319766527e-03, +1.281738983152997343e-03, +1.296997797583085364e-03, +1.312256612617136066e-03, +1.327515428262254923e-03, +1.342774244525547413e-03, +1.358033061414119014e-03, +1.373291878935075205e-03, +1.388550697095521466e-03, +1.403809515902563279e-03, +1.419068335363306127e-03, +1.434327155484855493e-03, +1.449585976274316863e-03, +1.464844797738795724e-03, +1.480103619885397562e-03, +1.495362442721227868e-03, +1.510621266253392131e-03, +1.525880090488995842e-03, +1.541138915435144495e-03, +1.556397741098943584e-03, +1.571656567487498605e-03, +1.586915394607915054e-03, +1.602174222467298429e-03, +1.617433051072754231e-03, +1.632691880431387959e-03, +1.647950710550305118e-03, +1.663209541436611210e-03, +1.678468373097411740e-03, +1.693727205539812216e-03, +1.708986038770918145e-03, +1.724244872797835038e-03, +1.739503707627668405e-03, +1.754762543267523759e-03, +1.770021379724506614e-03, +1.785280217005722485e-03, +1.800539055118276891e-03, +1.815797894069275349e-03, +1.831056733865823380e-03, +1.846315574515026505e-03, +1.861574416023990249e-03, +1.876833258399820136e-03, +1.892092101649621692e-03, +1.907350945780500447e-03, +1.922609790799561930e-03, +1.937868636713911673e-03, +1.953127483530655208e-03, +1.968386331256898072e-03, +1.983645179899745800e-03, +1.998904029466303930e-03, +2.014162879963678004e-03, +2.029421731398973562e-03, +2.044680583779296149e-03, +2.059939437111751309e-03, +2.075198291403444589e-03, +2.090457146661481539e-03, +2.105716002892967709e-03, +2.120974860105008652e-03, +2.136233718304709922e-03, +2.151492577499177074e-03, +2.166751437695515668e-03, +2.182010298900831262e-03, +2.197269161122229419e-03, +2.212528024366815702e-03, +2.227786888641695677e-03, +2.243045753953974911e-03, +2.258304620310758974e-03, +2.273563487719153436e-03, +2.288822356186263872e-03, +2.304081225719195856e-03, +2.319340096325054966e-03, +2.334598968010946781e-03, +2.349857840783976882e-03, +2.365116714651250853e-03, +2.380375589619874278e-03, +2.395634465696952746e-03, +2.410893342889591845e-03, +2.426152221204897168e-03, +2.441411100649974307e-03, +2.456669981231928858e-03, +2.471928862957866420e-03, +2.487187745834892592e-03, +2.502446629870112977e-03, +2.517705515070633178e-03, +2.532964401443558802e-03, +2.548223288995995458e-03, +2.563482177735048756e-03, +2.578741067667824310e-03, +2.593999958801427734e-03, +2.609258851142964647e-03, +2.624517744699540667e-03, +2.639776639478261418e-03, +2.655035535486232522e-03, +2.670294432730559608e-03, +2.685553331218348303e-03, +2.700812230956704239e-03, +2.716071131952733049e-03, +2.731330034213540370e-03, +2.746588937746231839e-03, +2.761847842557913096e-03, +2.777106748655689786e-03, +2.792365656046667553e-03, +2.807624564737952045e-03, +2.822883474736648912e-03, +2.838142386049863808e-03, +2.853401298684702386e-03, +2.868660212648270304e-03, +2.883919127947673223e-03, +2.899178044590016805e-03, +2.914436962582406715e-03, +2.929695881931948620e-03, +2.944954802645748191e-03, +2.960213724730911100e-03, +2.975472648194543022e-03, +2.990731573043749635e-03, +3.005990499285636619e-03, +3.021249426927309657e-03, +3.036508355975874435e-03, +3.051767286438436641e-03, +3.067026218322101964e-03, +3.082285151633976100e-03, +3.097544086381164744e-03, +3.112803022570773594e-03, +3.128061960209908352e-03, +3.143320899305674722e-03, +3.158579839865178411e-03, +3.173838781895525128e-03, +3.189097725403820586e-03, +3.204356670397170500e-03, +3.219615616882680587e-03, +3.234874564867456569e-03, +3.250133514358604168e-03, +3.265392465363229111e-03, +3.280651417888437126e-03, +3.295910371941333946e-03, +3.311169327529025305e-03, +3.326428284658616941e-03, +3.341687243337214594e-03, +3.356946203571924008e-03, +3.372205165369850928e-03, +3.387464128738101104e-03, +3.402723093683780288e-03, +3.417982060213994235e-03, +3.433241028335848702e-03, +3.448499998056449451e-03, +3.463758969382902245e-03, +3.479017942322312852e-03, +3.494276916881787041e-03, +3.509535893068430584e-03, +3.524794870889349259e-03, +3.540053850351648844e-03, +3.555312831462435120e-03, +3.570571814228813874e-03, +3.585830798657890892e-03, +3.601089784756771967e-03, +3.616348772532562893e-03, +3.631607761992369467e-03, +3.646866753143297490e-03, +3.662125745992452765e-03, +3.677384740546941101e-03, +3.692643736813868306e-03, +3.707902734800340194e-03, +3.723161734513462581e-03, +3.738420735960341288e-03, +3.753679739148082137e-03, +3.768938744083790955e-03, +3.784197750774573570e-03, +3.799456759227535816e-03, +3.814715769449783529e-03, +3.829974781448422548e-03, +3.845233795230558715e-03, +3.860492810803297877e-03, +3.875751828173745883e-03, +3.891010847349008585e-03, }, 

        // i0 有 9bit，所以有两组，i1/i2/i3 是 8bit
        { +0.000000000000000000e+00, +3.906269868336191839e-03, +7.812658949600007638e-03, +1.171928647127224492e-02, +1.562627168994382379e-02, +1.953373390588028856e-02, +2.344179247759764246e-02, +2.735056683645330104e-02, +3.126017650125595642e-02, +3.517074109289815333e-02, +3.908238034901538753e-02, +4.299521413867554942e-02, +4.690936247710254911e-02, +5.082494554043797425e-02, +5.474208368054464933e-02, +5.866089743985598348e-02, +6.258150756627501466e-02, +6.650403502812708011e-02, +7.042860102917006730e-02, +7.435532702366622510e-02, +7.828433473151954303e-02, +8.221574615348273540e-02, +8.614968358643789930e-02, +9.008626963875494783e-02, +9.402562724573195576e-02, +9.796787968512159166e-02, +1.019131505927478495e-01, +1.058615639782173342e-01, +1.098132442407293977e-01, +1.137683161849894689e-01, +1.177269050372299656e-01, +1.216891364613432289e-01, +1.256551365751309678e-01, +1.296250319666747606e-01, +1.335989497108322104e-01, +1.375770173858634133e-01, +1.415593630901924569e-01, +1.455461154593087302e-01, +1.495374036828128901e-01, +1.535333575216123983e-01, +1.575341073252716107e-01, +1.615397840495214763e-01, +1.655505192739339762e-01, +1.695664452197665101e-01, +1.735876947679815208e-01, +1.776144014774467276e-01, +1.816466996033214277e-01, +1.856847241156344116e-01, +1.897286107180591329e-01, +1.937784958668918635e-01, +1.978345167902386688e-01, +2.018968115074171329e-01, +2.059655188485788721e-01, +2.100407784745589808e-01, +2.141227308969586649e-01, +2.182115174984674325e-01, +2.223072805534313309e-01, +2.264101632486738375e-01, +2.305203097045761415e-01, +2.346378649964236790e-01, +2.387629751760259203e-01, +2.428957872936165424e-01, +2.470364494200412647e-01, +2.511851106692407674e-01, +2.553419212210362665e-01, +2.595070323442254697e-01, +2.636805964199967998e-01, +2.678627669656699352e-01, +2.720536986587708834e-01, +2.762535473614499834e-01, +2.804624701452514032e-01, +2.846806253162428914e-01, +2.889081724405147260e-01, +2.931452723700570005e-01, +2.973920872690245895e-01, +3.016487806403993421e-01, +3.059155173530592641e-01, +3.101924636692646706e-01, +3.144797872725715162e-01, +3.187776572961823421e-01, +3.230862443517455201e-01, +3.274057205586137179e-01, +3.317362595735727673e-01, +3.360780366210523751e-01, +3.404312285238303874e-01, +3.447960137342425950e-01, +3.491725723659103522e-01, +3.535610862259985768e-01, +3.579617388480169984e-01, +3.623747155251778386e-01, +3.668002033443234227e-01, +3.712383912204375566e-01, +3.756894699317548404e-01, +3.801536321554824432e-01, +3.846310725041492230e-01, +3.891219875625974478e-01, +3.936265759256327582e-01, +3.981450382363484065e-01, +4.026775772251402118e-01, +4.072243977494290937e-01, +4.117857068341084758e-01, +4.163617137127342962e-01, +4.209526298694758221e-01, +4.255586690818459356e-01, +4.301800474642300490e-01, +4.348169835122333051e-01, +4.394696981478662405e-01, +4.441384147655896211e-01, +4.488233592792397088e-01, +4.535247601698557887e-01, +4.582428485344323670e-01, +4.629778581356190585e-01, +4.677300254523917999e-01, +4.724995897317196703e-01, +4.772867930412522617e-01, +4.820918803230532253e-01, +4.869150994484063245e-01, +4.917567012737210528e-01, +4.966169396975656257e-01, +5.014960717188559297e-01, +5.063943574962298121e-01, +5.113120604086369191e-01, +5.162494471171751445e-01, +5.212067876282056265e-01, +5.261843553577791442e-01, +5.311824271974076981e-01, +5.362012835812160314e-01, +5.412412085545088473e-01, +5.463024898437905133e-01, +5.513854189282751078e-01, +5.564902911129257735e-01, +5.616174056030634756e-01, +5.667670655805864457e-01, +5.719395782818428096e-01, +5.771352550772001541e-01, +5.823544115523570908e-01, +5.875973675914432214e-01, +5.928644474619552982e-01, +5.981559799015788149e-01, +6.034722982069457495e-01, +6.088137403243807214e-01, +6.141806489426894179e-01, +6.195733715880447935e-01, +6.249922607210282491e-01, +6.304376738358847669e-01, +6.359099735620527994e-01, +6.414095277680316062e-01, +6.469367096676506875e-01, +6.524918979288079927e-01, +6.580754767847456815e-01, +6.636878361479343902e-01, +6.693293717266392087e-01, +6.750004851442429077e-01, +6.807015840614043752e-01, +6.864330823011327270e-01, +6.921953999768601526e-01, +6.979889636235992552e-01, +7.038142063322734309e-01, +7.096715678873117313e-01, +7.155614949076026538e-01, +7.214844409909044200e-01, +7.274408668618125297e-01, +7.334312405233887333e-01, +7.394560374125590411e-01, +7.455157405593919951e-01, +7.516108407503721822e-01, +7.577418366957878478e-01, +7.639092352013555153e-01, +7.701135513442087050e-01, +7.763553086533822048e-01, +7.826350392949278675e-01, +7.889532842618026112e-01, +7.953105935686741857e-01, +8.017075264517953400e-01, +8.081446515741023095e-01, +8.146225472356990205e-01, +8.211418015898941219e-01, +8.277030128649638803e-01, +8.343067895918201504e-01, +8.409537508377690505e-01, +8.476445264465526541e-01, +8.543797572848729611e-01, +8.611600954956046493e-01, +8.679862047579106386e-01, +8.748587605544823495e-01, +8.817784504461347037e-01, +8.887459743539944273e-01, +8.957620448495290837e-01, +9.028273874526735022e-01, +9.099427409383198980e-01, +9.171088576514480184e-01, +9.243265038311821156e-01, +9.315964599440724612e-01, +9.389195210269105027e-01, +9.462964970393986388e-01, +9.537282132270079823e-01, +9.612155104943704162e-01, +9.687592457895647472e-01, +9.763602924996708607e-01, +9.840195408579805011e-01, +9.917378983632686803e-01, +9.995162902115457818e-01, +1.007355659740727217e+00, +1.015256968888675033e+00, +1.023221198665084228e+00, +1.031249349637705690e+00, +1.039342442433417763e+00, +1.047501518254679409e+00, +1.055727639411919907e+00, +1.064021889872443022e+00, +1.072385375826447607e+00, +1.080819226270791841e+00, +1.089324593611154640e+00, +1.097902654283275471e+00, +1.106554609393982725e+00, +1.115281685382751186e+00, +1.124085134704560944e+00, +1.132966236534863482e+00, +1.141926297497495677e+00, +1.150966652416419154e+00, +1.160088665092201018e+00, +1.169293729104192382e+00, +1.178583268639403648e+00, +1.187958739349120065e+00, +1.197421629234347972e+00, +1.206973459561231372e+00, +1.216615785807630252e+00, +1.226350198642106483e+00, +1.236178324936620369e+00, +1.246101828814301125e+00, +1.256122412733717933e+00, +1.266241818611144894e+00, +1.276461828982383445e+00, +1.286784268205779743e+00, +1.297211003708152436e+00, +1.307743947275428377e+00, +1.318385056389870362e+00, +1.329136335615872277e+00, +1.339999838036393319e+00, +1.350977666742204543e+00, +1.362071976376228231e+00, +1.373284974735363809e+00, +1.384618924432313614e+00, +1.396076144620048187e+00, +1.407659012781684298e+00, +1.419369966588690115e+00, +1.431211505830481253e+00, +1.443186194418629464e+00, +1.455296662469072910e+00, +1.467545608465894075e+00, +1.479935801510418840e+00, +1.492470083659588995e+00, +1.505151372357771041e+00, +1.517982662966387464e+00, +1.530967031395993556e+00, +1.544107636845674244e+00, }, 
        { +1.557407724654902231e+00, +1.570870629273282195e+00, +1.584499777353906895e+00, +1.598298690976371051e+00, +1.612270991005829243e+00, +1.626420400594846017e+00, +1.640750748835171718e+00, +1.655265974566987720e+00, +1.669970130353601668e+00, +1.684867386630038935e+00, +1.699962036034472873e+00, +1.715258497931965893e+00, +1.730761323140558369e+00, +1.746475198870345528e+00, +1.762404953886826734e+00, +1.778555563910500059e+00, +1.794932157265411112e+00, +1.811540020790152486e+00, +1.828384606025652914e+00, +1.845471535694997553e+00, +1.862806610491487610e+00, +1.880395816192183795e+00, +1.898245331115289534e+00, +1.916361533940922538e+00, +1.934751011916103924e+00, +1.953420569466169781e+00, +1.972377237236288883e+00, +1.991628281588360788e+00, +2.011181214580280246e+00, +2.031043804456397096e+00, +2.051224086679986916e+00, +2.071730375540689072e+00, +2.092571276372179004e+00, +2.113755698417835680e+00, +2.135292868384859313e+00, +2.157192344730206926e+00, +2.179464032724863739e+00, +2.202118200346378720e+00, +2.225165495053286713e+00, +2.248616961499044142e+00, +2.272484060247449371e+00, +2.296778687556234873e+00, +2.321513196300642001e+00, +2.346700418114360045e+00, +2.372353686831272985e+00, +2.398486863318058677e+00, +2.425114361794879856e+00, +2.452251177749254243e+00, +2.479912917556758792e+00, +2.508115829931584724e+00, +2.536876839340198212e+00, +2.566213581522568413e+00, +2.596144441277702967e+00, +2.626688592683696187e+00, +2.657866041937275693e+00, +2.689697673014073650e+00, +2.722205296368710927e+00, +2.755411700913448462e+00, +2.789340709535834569e+00, +2.824017238439690305e+00, +2.859467360620187426e+00, +2.895718373812978401e+00, +2.932798873289667331e+00, +2.970738829907740452e+00, +3.009569673862831288e+00, +3.049324384635362547e+00, +3.090037587672735012e+00, +3.131745658402949935e+00, +3.174486834236571105e+00, +3.218301335282073144e+00, +3.263231494575819107e+00, +3.309321898713235442e+00, +3.356619539863437447e+00, +3.405173980257020171e+00, +3.455037530357601233e+00, +3.506265442063868574e+00, +3.558916118442528969e+00, +3.613051341666200280e+00, +3.668736521026878674e+00, +3.726040963118558743e+00, +3.785038166535876194e+00, +3.845806143723938903e+00, +3.908427772943271575e+00, +3.972991183689432251e+00, +4.039590179336910458e+00, +4.108324701270290093e+00, +4.179301339332886950e+00, +4.252633894076642408e+00, +4.328443997051826678e+00, +4.406861796248792917e+00, +4.488026714817815712e+00, +4.572088292372360132e+00, +4.659207119556542572e+00, +4.749555878165976114e+00, +4.843320500997345504e+00, +4.940701467820253235e+00, +5.041915256481363321e+00, +5.147195971246721608e+00, +5.256797174162962044e+00, +5.370993949594780314e+00, +5.490085237326734046e+00, +5.614396475891370737e+00, +5.744282605339330362e+00, +5.880131487797170208e+00, +6.022367815239457477e+00, +6.171457587407517523e+00, +6.327913259342501829e+00, +6.492299678339468719e+00, +6.665240955269686871e+00, +6.847428446453746746e+00, +7.039630061285509331e+00, +7.242701159822042689e+00, +7.457597366497314807e+00, +7.685389704890301095e+00, +7.927282559320507626e+00, +8.184635099046553983e+00, +8.458986969686536389e+00, +8.752089277498696219e+00, +9.065942183909928518e+00, +9.402840816234259165e+00, +9.765431722939984318e+00, +1.015678281138351659e+01, +1.058047068020592489e+01, +1.104069061206323908e+01, +1.154239639643118821e+01, +1.209147986753967997e+01, +1.269500397217797515e+01, +1.336150896117126166e+01, +1.410141994717171939e+01, +1.492759726592926801e+01, +1.585609163763455654e+01, +1.690719891898538886e+01, +1.810696292770287056e+01, +1.948936533223488865e+01, +2.109959930014605786e+01, +2.299910889067736420e+01, +2.527361509038201022e+01, +2.804641990164796488e+01, +3.150153636796483209e+01, +3.592629963310116066e+01, +4.179572721879399132e+01, +4.995566453462134827e+01, +6.207239752060167631e+01, +8.194583668852653745e+01, +1.205325057225426127e+02, +2.277849847401601069e+02, +2.066855189746603515e+03, -2.921894914044914341e+02, -1.364479038428448102e+02, -8.900442903712162050e+01, -6.604003315407891456e+01, -5.249419050184378370e+01, -4.355836040673973129e+01, -3.722123461188578978e+01, -3.249297383478359174e+01, -2.882980622160111303e+01, -2.590819649965075805e+01, -2.352359839587070445e+01, -2.154035881603768392e+01, -1.986496558165879491e+01, -1.843086276236962258e+01, -1.718939044676359664e+01, -1.610414860584440060e+01, -1.514736478072976979e+01, -1.429748093027240127e+01, -1.353750732713525940e+01, -1.285387336239024467e+01, -1.223560863973429739e+01, -1.167374867215481348e+01, -1.116089645366633609e+01, -1.069089420670968367e+01, -1.025857430242825504e+01, -9.859567936016037035e+00, -9.490156514594122202e+00, -9.147155032038381876e+00, -8.827819676652120722e+00, -8.529773993911653209e+00, -8.250949397622018887e+00, -7.989536878572158385e+00, -7.743947526513809999e+00, -7.512780044322006569e+00, -7.294793850934424282e+00, -7.088886682610810636e+00, -6.894075838620509713e+00, -6.709482397820695376e+00, -6.534317871189622327e+00, -6.367872862698656741e+00, -6.209507394596988169e+00, -6.058642618886419606e+00, -5.914753688675507290e+00, -5.777363604365883622e+00, -5.646037882611668190e+00, -5.520379922509330168e+00, -5.400026964900787452e+00, -5.284646558070290353e+00, -5.173933457309794838e+00, -5.067606897460394345e+00, -4.965408187112387137e+00, -4.867098581060394451e+00, -4.772457394176775634e+00, -4.681280325336429567e+00, -4.593377964598829170e+00, -4.508574460689356838e+00, -4.426706329051191548e+00, -4.347621383466028725e+00, -4.271177776552081564e+00, -4.197243136410738142e+00, -4.125693788365973035e+00, -4.056414052170035671e+00, -3.989295606273755568e+00, -3.924236911812048471e+00, -3.861142689861477867e+00, -3.799923446309182051e+00, -3.740495039349632059e+00, -3.682778285213053793e+00, -3.626698598239964770e+00, -3.572185661861125860e+00, -3.519173127430570323e+00, -3.467598338199105531e+00, -3.417402076013459745e+00, -3.368528328587746422e+00, -3.320924075423986798e+00, -3.274539090661210244e+00, -3.229325761311691168e+00, -3.185238919501229170e+00, -3.142235687470659205e+00, -3.100275334220252527e+00, -3.059319142789291609e+00, -3.019330287261564793e+00, -2.980273718675296354e+00, -2.942116059094379806e+00, -2.904825503167826175e+00, -2.868371726567042158e+00, -2.832725800746760444e+00, -2.797860113525895285e+00, -2.763748295029938336e+00, -2.730365148577311242e+00, -2.697686586128852146e+00, -2.665689567952772943e+00, -2.634352046187370514e+00, -2.603652912010850547e+00, -2.573571946152129598e+00, -2.544089772498687524e+00, -2.515187814577685931e+00, -2.486848254704859487e+00, -2.459053995612313260e+00, -2.431788624381487329e+00, -2.405036378521328292e+00, -2.378782114044268463e+00, -2.353011275404075799e+00, -2.327709867170106779e+00, -2.302864427322065166e+00, -2.278462002058126785e+00, -2.254490122017310173e+00, -2.230936779824323627e+00, -2.207790408871862213e+00, }, 
    };
    #elif xuse_math_tan_lut8x16
    constexpr xalign(64) f64 lut[][16] = {
        { +0.000000000000000000e+00, +2.328306436538696289e-10, +4.656612873077392579e-10, +6.984919309616088868e-10, +9.313225746154785159e-10, +1.164153218269348145e-09, +1.396983861923217774e-09, +1.629814505577087404e-09, +1.862645149230957033e-09, +2.095475792884826663e-09, +2.328306436538696293e-09, +2.561137080192565924e-09, +2.793967723846435554e-09, +3.026798367500305185e-09, +3.259629011154174816e-09, +3.492459654808044448e-09, }, 
        { +0.000000000000000000e+00, +3.725290298461914080e-09, +7.450580596923828263e-09, +1.117587089538574265e-08, +1.490116119384765735e-08, +1.862645149230957247e-08, +2.235174179077148810e-08, +2.607703208923340435e-08, +2.980232238769532132e-08, +3.352761268615723913e-08, +3.725290298461915786e-08, +4.097819328308107763e-08, +4.470348358154299853e-08, +4.842877388000492067e-08, +5.215406417846684416e-08, +5.587935447692876910e-08, }, 
        { +0.000000000000000000e+00, +5.960464477539069559e-08, +1.192092895507818147e-07, +1.788139343261737808e-07, +2.384185791015670175e-07, +2.980232238769619483e-07, +3.576278686523589966e-07, +4.172325134277585860e-07, +4.768371582031611401e-07, +5.364418029785670823e-07, +5.960464477539768361e-07, +6.556510925293908251e-07, +7.152557373048094727e-07, +7.748603820802332026e-07, +8.344650268556624382e-07, +8.940696716310976030e-07, }, 
        { +0.000000000000000000e+00, +9.536743164065391206e-07, +1.907348632814812965e-06, +2.861022949226556256e-06, +3.814697265643503717e-06, +4.768371582067390072e-06, +5.722045898499950045e-06, +6.675720214942918359e-06, +7.629394531398029737e-06, +8.583068847867018902e-06, +9.536743164351620579e-06, +1.049041748085356949e-05, +1.144409179737460036e-05, +1.239776611391644791e-05, +1.335144043048084687e-05, +1.430511474706953196e-05, }, 
        { +0.000000000000000000e+00, +1.525878906368423789e-05, +3.051757813447390315e-05, +4.577636721947442314e-05, +6.103515632579122526e-05, +7.629394546052973696e-05, +9.155273463079538573e-05, +1.068115238436935991e-04, +1.220703131063298048e-04, +1.373291024258094305e-04, +1.525878918092379040e-04, +1.678466812637206533e-04, +1.831054707963631064e-04, +1.983642604142706917e-04, +2.136230501245488375e-04, +2.288818399343029724e-04, }, 
        { +0.000000000000000000e+00, +2.441406298506385251e-04, +4.882812888051109764e-04, +7.324220059672651578e-04, +9.765628104409766290e-04, +1.220703731330162583e-03, +1.464844797738795724e-03, +1.708986038770918145e-03, +1.953127483530655208e-03, +2.197269161122229419e-03, +2.441411100649974307e-03, +2.685553331218348303e-03, +2.929695881931948620e-03, +3.173838781895525128e-03, +3.417982060213994235e-03, +3.662125745992452765e-03, }, 
        { +0.000000000000000000e+00, +3.906269868336191839e-03, +7.812658949600007638e-03, +1.171928647127224492e-02, +1.562627168994382379e-02, +1.953373390588028856e-02, +2.344179247759764246e-02, +2.735056683645330104e-02, +3.126017650125595642e-02, +3.517074109289815333e-02, +3.908238034901538753e-02, +4.299521413867554942e-02, +4.690936247710254911e-02, +5.082494554043797425e-02, +5.474208368054464933e-02, +5.866089743985598348e-02, }, 

        // i0 有 5bit，所以有两组，i1/i2/i3/i4/i5/i6/i7 是 4bit
        { +0.000000000000000000e+00, +6.258150756627501466e-02, +1.256551365751309678e-01, +1.897286107180591329e-01, +2.553419212210362665e-01, +3.230862443517455201e-01, +3.936265759256327582e-01, +4.677300254523917999e-01, +5.463024898437905133e-01, +6.304376738358847669e-01, +7.214844409909044200e-01, +8.211418015898941219e-01, +9.315964599440724612e-01, +1.055727639411919907e+00, +1.197421629234347972e+00, +1.362071976376228231e+00, }, 
        { +1.557407724654902231e+00, +1.794932157265411112e+00, +2.092571276372179004e+00, +2.479912917556758792e+00, +3.009569673862831288e+00, +3.785038166535876194e+00, +5.041915256481363321e+00, +7.457597366497314807e+00, +1.410141994717171939e+01, +1.205325057225426127e+02, -1.843086276236962258e+01, -8.529773993911653209e+00, -5.520379922509330168e+00, -4.056414052170035671e+00, -3.185238919501229170e+00, -2.603652912010850547e+00, },
    };
    #endif

    // 注意：
    // 本函数有定义域范围限制
    // x 属于 (-pi/2, +pi/2) 的开区间
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    extern f64 tan_unsafe(f64 x){
        // 作者吐槽：_mmxxx_i32gather_xxx 让作者很失望，好看不好用，性能还不及分次单独访问内存
        using namespace inc;

        if (x == 0){
            return 0;
        }

        // 本算法利用到此公式
        // tan(α+β)=(tanα+tanβ)/(1-tanα·tanβ)
        // 分成 tanα 和 tanβ 两部分
        // tanα 用查表计算+带入上述公式，tanβ 用微分计算(可以节省一半的计算量)
        // tanα 用 tan(α+β) 公式进一步拆分
        // tanβ == β when β -> 1/inf (default about 1e-10)
        auto is_neg         = x < 0;
        auto m              = mf64{inc::abs(x)}; // 先按正数处理，然后返回时再处理符号问题
        auto exp            = m.real_exp(); // 约定: exp <= 2

        // 直接用 tanβ，精度满足
        if (exp < -ixx(m.bits_of_precision() / 2)){
            return x;
        }

        constexpr
        auto bits_of_alpha  = 32;
        constexpr 
        auto bits_of_beta   = m.bits_of_mantissa() - bits_of_alpha;
        auto bits_of_betax  = bits_of_beta - exp;
        auto beta           = m;
        auto r0             = f64(0);
        auto r1             = f64(0);
        auto r2             = f64(0);
        auto r3             = f64(0);
        auto deci           = u64{};

        m.decimal         >>= bits_of_betax;
        m.decimal         <<= bits_of_betax;    // 清除 β 部分的位
        beta                = beta - m;         // 得到小数 β

        deci                = exp < 0 ?         // 位置 1
            m.real_dec() >> -exp : 
            m.real_dec() << +exp;

        #if xuse_math_tan_lut4x256
        union {
            struct{
                u64 i3 : bits_of_alpha / 4;
                u64 i2 : bits_of_alpha / 4;
                u64 i1 : bits_of_alpha / 4;
                u64 i0 : bits_of_alpha / 4 + 1;
            };
            u64 full;
        }idx;

        // 由于在位置 1 已经包含 exp 部分的移位，
        // 所以这里使用 bits_of_beta，而非 bits_of_betax
        idx.full    = deci >> bits_of_beta;

        r0          = lut[3][idx.i0];
        r1          = lut[2][idx.i1];
        r2          = lut[1][idx.i2];
        r3          = lut[0][idx.i3];
        
        #elif xuse_math_tan_lut8x16
        union {
            struct{
                u64 i7 : bits_of_alpha / 8;
                u64 i6 : bits_of_alpha / 8;
                u64 i5 : bits_of_alpha / 8;
                u64 i4 : bits_of_alpha / 8;
                u64 i3 : bits_of_alpha / 8;
                u64 i2 : bits_of_alpha / 8;
                u64 i1 : bits_of_alpha / 8;
                u64 i0 : bits_of_alpha / 8 + 1;
            };
            u64 full;
        }idx;

        // 由于在位置 1 已经包含 exp 部分的移位，
        // 所以这里使用 bits_of_beta，而非 bits_of_betax
        idx.full    = deci >> bits_of_beta;

        {
            auto a0 = lut[7][idx.i0];
            auto b0 = lut[6][idx.i1];
            auto a1 = lut[5][idx.i2];
            auto b1 = lut[4][idx.i3];

            auto a2 = lut[3][idx.i4];
            auto b2 = lut[2][idx.i5];
            auto a3 = lut[1][idx.i6];
            auto b3 = lut[0][idx.i7];

            // tan(α+β)=(tanα+tanβ)/(1-tanα·tanβ)
            auto s0 = a0 + b0;          // tanα+tanβ SIMD 4组并行计算
            auto s1 = a1 + b1;
            auto s2 = a2 + b2;
            auto s3 = a3 + b3;
            
            auto m0 = 1.0 - a0 * b0;    // 1 - tanα·tanβ SIMD 4组并行计算
            auto m1 = 1.0 - a1 * b1;
            auto m2 = 1.0 - a2 * b2;
            auto m3 = 1.0 - a3 * b3;

            r0      = s0 / m0;
            r1      = s1 / m1;
            r2      = s2 / m2;
            r3      = s3 / m3;
        }
        #endif


        {
            // 整数部分是 1
            auto a1 = r1;
            auto b1 = r2;
            auto a2 = r3;
            auto b2 = beta;

            // 尽量让指数部分接近的浮点数运算可以减少精度损失
            auto s1 = a1 + b1;
            auto s2 = a2 + b2;

            auto m1 = 1.0 - a1 * b1;
            auto m2 = 1.0 - a2 * b2;

            r1      = s1 / m1;
            r2      = s2 / m2;
        }

        auto sum3   = r1 + r2;
        auto mix3   = 1.0 - r1 * r2;
        auto r      = (sum3 + r0 * mix3) / (mix3 - r0 * sum3);
        return is_neg ? -r : r;
    }

    extern f64 tan(f64 x){
        if (inc::abs(x) < inc::pi / 2){
            return tan_unsafe(x);
        }
        return ::tan(x);
    }
}

#undef  xuser
#define xuser mixc::math_atan::inc
#include"configure/switch.hpp"
#include"utils/mfxx.hpp"
#include"math/literal.hpp"

namespace mixc::math_atan::inc{
    using namespace literal;
}

namespace mixc::math_atan::origin{
    #if xuse_math_atan_lut7x16
    constexpr auto step = 4;
    constexpr f64  lut[][16] = {
        { 0.000000000000000000e+00, 6.241880999595734847e-02, 1.243549945467614350e-01, 1.853479499956947649e-01, 2.449786631268641542e-01, 3.028848683749714056e-01, 3.587706702705722204e-01, 4.124104415973873069e-01, 4.636476090008061162e-01, 5.123894603107377067e-01, 5.585993153435624360e-01, 6.022873461349641817e-01, 6.435011087932843868e-01, 6.823165548747480783e-01, 7.188299996216245054e-01, 7.531512809621943895e-01, },
        { 0.000000000000000000e+00, 3.906230131966971828e-03, 7.812341060101111296e-03, 1.171821360239412864e-02, 1.562372862047683080e-02, 1.952876704141370725e-02, 2.343320987946758445e-02, 2.733693825782441191e-02, 3.123983343026827625e-02, 3.514177680279678267e-02, 3.904264995516699345e-02, 4.294233466236217276e-02, 4.684071291596965375e-02, 5.073766694546021984e-02, 5.463307923935947507e-02, 5.852683256630176997e-02, },
        { 0.000000000000000000e+00, 2.441406201493617640e-04, 4.882812111948982755e-04, 7.324217440328050985e-04, 9.765621895593194304e-04, 1.220702518670740919e-03, 1.464842702263452477e-03, 1.708982711233941100e-03, 1.953122516478818685e-03, 2.197262088894842840e-03, 2.441401399378937705e-03, 2.685540418828214766e-03, 2.929679118139993667e-03, 3.173817468211823031e-03, 3.417955439941501267e-03, 3.662093004227097389e-03, },
        { 0.000000000000000000e+00, 1.525878906131576211e-05, 3.051757811552609686e-05, 4.577636715552557693e-05, 6.103515617420877502e-05, 7.629394516447026390e-05, 9.155273411920461641e-05, 1.068115230313064055e-04, 1.220703118936702042e-04, 1.373291006991905858e-04, 1.525878894407621236e-04, 1.678466781112793911e-04, 1.831054667036369622e-04, 1.983642552107294107e-04, 2.136230436254513108e-04, 2.288818319406972370e-04, },
        { 0.000000000000000000e+00, 9.536743164059608794e-07, 1.907348632810187035e-06, 2.861022949210943744e-06, 3.814697265606496283e-06, 4.768371581995109928e-06, 5.722045898375049955e-06, 6.675720214744581641e-06, 7.629394531101970264e-06, 8.583068847445481098e-06, 9.536743163773379421e-06, 1.049041748008393051e-05, 1.144409179637539964e-05, 1.239776611264605209e-05, 1.335144042889415313e-05, 1.430511474511796804e-05, },
        { 0.000000000000000000e+00, 5.960464477539055441e-08, 1.192092895507806853e-07, 1.788139343261699692e-07, 2.384185791015579825e-07, 2.980232238769443017e-07, 3.576278686523285034e-07, 4.172325134277101640e-07, 4.768371582030888599e-07, 5.364418029784641677e-07, 5.960464477538356639e-07, 6.556510925292029249e-07, 7.152557373045655273e-07, 7.748603820799230474e-07, 8.344650268552750618e-07, 8.940696716306211470e-07, },
        { 0.000000000000000000e+00, 3.725290298461914045e-09, 7.450580596923827987e-09, 1.117587089538574172e-08, 1.490116119384765515e-08, 1.862645149230956816e-08, 2.235174179077148065e-08, 2.607703208923339253e-08, 2.980232238769530368e-08, 3.352761268615721400e-08, 3.725290298461912339e-08, 4.097819328308103175e-08, 4.470348358154293897e-08, 4.842877388000484495e-08, 5.215406417846674959e-08, 5.587935447692865278e-08, },
    };
    #elif xuse_math_atan_lut4x256
    constexpr auto step = 8;
    constexpr f64  lut[][256] = {
        { 0.000000000000000000, 0.062418809995957348, 0.124354994546761435, 0.185347949995694765, 0.244978663126864154, 0.302884868374971406, 0.358770670270572220, 0.412410441597387307, 0.463647609000806116, 0.512389460310737707, 0.558599315343562436, 0.602287346134964182, 0.643501108793284387, 0.682316554874748078, 0.718829999621624505, 0.753151280962194390, 0.785398163397448310, 0.815691923316223411, 0.844153986113171003, 0.870903457075652953, 0.896055384571343956, 0.919719605350416817, 0.942000040379463665, 0.962994330680936202, 0.982793723247329068, 1.001483135694234733, 1.019141344266349735, 1.035841253008800177, 1.051650212548373667, 1.066630365315743563, 1.080839000541168311, 1.094328907321189920, 1.107148717794090503, 1.119343235242342319, 1.130953743979160446, 1.142018299348880232, 1.152571997215667518, 1.162647223039807339, 1.172273881128476387, 1.181479604961755762, 1.190289949682531733, 1.198728567936776168, 1.206817370285252530, 1.214576671398746412, 1.222025323210989637, 1.229180836147089455, 1.236059489478081942, 1.242676431779591235, 1.249045772398254426, 1.255180664756130338, 1.261093382252440419, 1.266795387454752038, 1.272297395208717341, 1.277609430237014420, 1.282740879744270747, 1.287700541495401107, 1.292496667789785268, 1.297137005712806226, 1.301628834009196144, 1.305978996889107754, 1.310193935047555634, 1.314279714150573057, 1.318242051016837050, 1.322086337701373749, 1.325817663668032465, 1.329440836219492820, 1.332960399337445868, 1.336380651071085834, 1.339705659598999539, 1.342939278077796893, 1.346085158380253931, 1.349146763816219026, 1.352127380920954657, 1.355030130387854318, 1.357857977215499475, 1.360613740132727078, 1.363300100359693954, 1.365919609757788147, 1.368474698416592878, 1.370967681721906404, 1.373400766945015861, 1.375776059389975226, 1.378095568132511044, 1.380361211381342471, 1.382574821490125858, 1.384738149645892817, 1.386852870257721454, 1.388920585067442655, 1.390942827002418349, 1.392921063788820060, 1.394856701342368782, 1.396751086952157907, 1.398605512271957595, 1.400421216132280650, 1.402199387185467011, 1.403941166395107519, 1.405647649380269781, 1.407319888624202551, 1.408958895556473695, 1.410565642516834550, 1.412141064608495215, 1.413686061447936125, 1.415201498817866908, 1.416688210229470131, 1.418146998399631459, 1.419578636648455914, 1.420983870221999257, 1.422363417544801553, 1.423717971406494119, 1.425048200086459289, 1.426354748420252640, 1.427638238811247767, 1.428899272190732696, 1.430138428929473060, 1.431356269703558898, 1.432553336317168110, 1.433730152484708987, 1.434887224574645949, 1.436025042317165523, 1.437144079477702933, 1.438244794498222598, 1.439327631108027610, 1.440393018905763217, 1.441441373914176862, 1.442473099109101820, 1.443488584924042495, 1.444488209731656365, 1.445472340303350122, 1.446441332248135184, 1.447395530431820226, 1.448335269377555192, 1.449260873648682249, 1.450172658214793900, 1.451070928801846796, 1.451955982227131420, 1.452828106719852473, 1.453687582228032336, 1.454534680712410177, 1.455369666427971899, 1.456192796193711134, 1.457004319651188553, 1.457804479512425912, 1.458593511797642213, 1.459371646063312100, 1.460139105621000973, 1.460896107747407170, 1.461642863886018887, 1.462379579840772138, 1.463106455962075933, 1.463823687325551912, 1.464531463903817812, 1.465229970731627281, 1.465919388064662723, 1.466599891532262818, 1.467271652284352269, 1.467934837132827959, 1.468589608687643084, 1.469236125487818940, 1.469874542127602769, 1.470505009377979428, 1.471127674303734592, 1.471742680376257659, 1.472350167582263539, 1.472950272528603957, 1.473543128543330845, 1.474128865773166720, 1.474707611277529716, 1.475279489119254066, 1.475844620452140299, 1.476403123605463249, 1.476955114165560107, 1.477500705054615203, 1.478040006606752874, 1.478573126641544828, 1.479100170535033592, 1.479621241288369142, 1.480136439594151506, 1.480645863900568023, 1.481149610473410101, 1.481647773456050554, 1.482140444927459154, 1.482627714958330622, 1.483109671665396145, 1.483586401263986437, 1.484057988118911507, 1.484524514793719510, 1.484986062098394458, 1.485442709135550077, 1.485894533345174668, 1.486341610547979627, 1.486784014987402040, 1.487221819370309764, 1.487655094906455389, 1.488083911346723608, 1.488508337020214735, 1.488928438870205379, 1.489344282489025642, 1.489755932151890662, 1.490163450849722800, 1.490566900320999350, 1.490966341082659303, 1.491361832460101340, 1.491753432616304034, 1.492141198580098009, 1.492525186273618657, 1.492905450538966959, 1.493282045164104838, 1.493655022908010549, 1.494024435525118580, 1.494390333789067654, 1.494752767515779540, 1.495111785585890509, 1.495467435966556501, 1.495819765732652245, 1.496168821087383877, 1.496514647382333853, 1.496857289136956276, 1.497196790057540119, 1.497533193055657161, 1.497866540266110890, 1.498196873064401995, 1.498524232083725570, 1.498848657231514566, 1.499170187705543547, 1.499488862009606293, 1.499804717968780331, 1.500117792744291014, 1.500428122847987328, 1.500735744156441185, 1.501040691924681571, 1.501343000799574500, 1.501642704832859381, 1.501939837493852020, 1.502234431681824157, 1.502526519738069080, 1.502816133457662548, 1.503103304100927968, 1.503388062404614421, 1.503670438592795913, 1.503950462387499885, 1.504228163019072815, 1.504503569236290424, 1.504776709316219817, 1.505047611073840599, 1.505316301871431808, 1.505582808627731286, 1.505847157826873870, 1.506109375527114619, 1.506369487369343069, 1.506627518585394321, 1.506883494006162596, 1.507137438069522692, 1.507389374828064639, 1.507639327956646649, 1.507887320759771323, 1.508133376178789909, },
        { 0.000000000000000000, 0.000244140620149362, 0.000488281211194898, 0.000732421744032805, 0.000976562189559319, 0.001220702518670741, 0.001464842702263452, 0.001708982711233941, 0.001953122516478819, 0.002197262088894843, 0.002441401399378938, 0.002685540418828215, 0.002929679118139994, 0.003173817468211823, 0.003417955439941501, 0.003662093004227097, 0.003906230131966972, 0.004150366794059797, 0.004394502961404579, 0.004638638604900678, 0.004882773695447826, 0.005126908203946155, 0.005371042101296210, 0.005615175358398975, 0.005859307946155889, 0.006103439835468873, 0.006347570997240346, 0.006591701402373248, 0.006835831021771059, 0.007079959826337822, 0.007324087786978161, 0.007568214874597307, 0.007812341060101111, 0.008056466314396073, 0.008300590608389357, 0.008544713912988812, 0.008788836199102999, 0.009032957437641204, 0.009277077599513462, 0.009521196655630580, 0.009765314576904153, 0.010009431334246591, 0.010253546898571133, 0.010497661240791872, 0.010741774331823776, 0.010985886142582706, 0.011229996643985440, 0.011474105806949691, 0.011718213602394129, 0.011962320001238402, 0.012206424974403157, 0.012450528492810061, 0.012694630527381817, 0.012938731049042195, 0.013182830028716041, 0.013426927437329306, 0.013671023245809065, 0.013915117425083536, 0.014159209946082099, 0.014403300779735324, 0.014647389896974984, 0.014891477268734080, 0.015135562865946860, 0.015379646659548842, 0.015623728620476831, 0.015867808719668943, 0.016111886928064626, 0.016355963216604676, 0.016600037556231265, 0.016844109917887955, 0.017088180272519722, 0.017332248591072978, 0.017576314844495588, 0.017820379003736894, 0.018064441039747734, 0.018308500923480464, 0.018552558625888976, 0.018796614117928724, 0.019040667370556737, 0.019284718354731647, 0.019528767041413707, 0.019772813401564810, 0.020016857406148511, 0.020260899026130050, 0.020504938232476368, 0.020748974996156131, 0.020993009288139751, 0.021237041079399405, 0.021481070340909056, 0.021725097043644474, 0.021969121158583257, 0.022213142656704850, 0.022457161508990570, 0.022701177686423621, 0.022945191159989118, 0.023189201900674106, 0.023433209879467584, 0.023677215067360522, 0.023921217435345882, 0.024165216954418641, 0.024409213595575808, 0.024653207329816451, 0.024897198128141710, 0.025141185961554821, 0.025385170801061138, 0.025629152617668153, 0.025873131382385515, 0.026117107066225051, 0.026361079640200789, 0.026605049075328974, 0.026849015342628094, 0.027092978413118897, 0.027336938257824412, 0.027580894847769972, 0.027824848153983230, 0.028068798147494186, 0.028312744799335200, 0.028556688080541020, 0.028800627962148796, 0.029044564415198106, 0.029288497410730973, 0.029532426919791887, 0.029776352913427825, 0.030020275362688273, 0.030264194238625244, 0.030508109512293301, 0.030752021154749575, 0.030995929137053790, 0.031239833430268276, 0.031483734005457999, 0.031727630833690572, 0.031971523886036283, 0.032215413133568113, 0.032459298547361753, 0.032703180098495631, 0.032947057758050926, 0.033190931497111594, 0.033434801286764385, 0.033678667098098864, 0.033922528902207433, 0.034166386670185351, 0.034410240373130751, 0.034654089982144667, 0.034897935468331048, 0.035141776802796783, 0.035385613956651718, 0.035629446901008681, 0.035873275606983497, 0.036117100045695011, 0.036360920188265110, 0.036604736005818742, 0.036848547469483933, 0.037092354550391815, 0.037336157219676638, 0.037579955448475798, 0.037823749207929852, 0.038067538469182540, 0.038311323203380806, 0.038555103381674818, 0.038798878975217988, 0.039042649955166993, 0.039286416292681796, 0.039530177958925663, 0.039773934925065187, 0.040017687162270307, 0.040261434641714330, 0.040505177334573946, 0.040748915212029255, 0.040992648245263784, 0.041236376405464506, 0.041480099663821863, 0.041723817991529786, 0.041967531359785713, 0.042211239739790613, 0.042454943102749000, 0.042698641419868962, 0.042942334662362173, 0.043186022801443919, 0.043429705808333115, 0.043673383654252327, 0.043917056310427791, 0.044160723748089435, 0.044404385938470896, 0.044648042852809543, 0.044891694462346497, 0.045135340738326652, 0.045378981651998690, 0.045622617174615108, 0.045866247277432235, 0.046109871931710251, 0.046353491108713210, 0.046597104779709058, 0.046840712915969654, 0.047084315488770789, 0.047327912469392210, 0.047571503829117634, 0.047815089539234774, 0.048058669571035355, 0.048302243895815135, 0.048545812484873928, 0.048789375309515620, 0.049032932341048193, 0.049276483550783740, 0.049520028910038491, 0.049763568390132828, 0.050007101962391309, 0.050250629598142685, 0.050494151268719922, 0.050737666945460220, 0.050981176599705034, 0.051224680202800093, 0.051468177726095421, 0.051711669140945355, 0.051955154418708569, 0.052198633530748088, 0.052442106448431315, 0.052685573143130045, 0.052929033586220488, 0.053172487749083290, 0.053415935603103549, 0.053659377119670838, 0.053902812270179224, 0.054146241026027290, 0.054389663358618150, 0.054633079239359475, 0.054876488639663508, 0.055119891530947085, 0.055363287884631659, 0.055606677672143314, 0.055850060864912786, 0.056093437434375489, 0.056336807351971525, 0.056580170589145714, 0.056823527117347604, 0.057066876908031499, 0.057310219932656474, 0.057553556162686397, 0.057796885569589949, 0.058040208124840641, 0.058283523799916836, 0.058526832566301770, 0.058770134395483569, 0.059013429258955272, 0.059256717128214845, 0.059499997974765209, 0.059743271770114251, 0.059986538485774853, 0.060229798093264902, 0.060473050564107316, 0.060716295869830065, 0.060959533981966183, 0.061202764872053797, 0.061445988511636139, 0.061689204872261571, 0.061932413925483601, 0.062175615642860906, },
        { 0.000000000000000000, 0.000000953674316406, 0.000001907348632810, 0.000002861022949211, 0.000003814697265606, 0.000004768371581995, 0.000005722045898375, 0.000006675720214745, 0.000007629394531102, 0.000008583068847445, 0.000009536743163773, 0.000010490417480084, 0.000011444091796375, 0.000012397766112646, 0.000013351440428894, 0.000014305114745118, 0.000015258789061316, 0.000016212463377486, 0.000017166137693626, 0.000018119812009736, 0.000019073486325812, 0.000020027160641854, 0.000020980834957859, 0.000021934509273826, 0.000022888183589753, 0.000023841857905639, 0.000024795532221481, 0.000025749206537278, 0.000026702880853028, 0.000027656555168730, 0.000028610229484381, 0.000029563903799981, 0.000030517578115526, 0.000031471252431016, 0.000032424926746449, 0.000033378601061823, 0.000034332275377136, 0.000035285949692386, 0.000036239624007573, 0.000037193298322693, 0.000038146972637746, 0.000039100646952730, 0.000040054321267642, 0.000041007995582482, 0.000041961669897247, 0.000042915344211935, 0.000043869018526546, 0.000044822692841076, 0.000045776367155526, 0.000046730041469892, 0.000047683715784172, 0.000048637390098367, 0.000049591064412472, 0.000050544738726488, 0.000051498413040411, 0.000052452087354241, 0.000053405761667976, 0.000054359435981613, 0.000055313110295152, 0.000056266784608589, 0.000057220458921925, 0.000058174133235156, 0.000059127807548282, 0.000060081481861300, 0.000061035156174209, 0.000061988830487007, 0.000062942504799691, 0.000063896179112262, 0.000064849853424716, 0.000065803527737053, 0.000066757202049269, 0.000067710876361364, 0.000068664550673336, 0.000069618224985183, 0.000070571899296904, 0.000071525573608496, 0.000072479247919958, 0.000073432922231288, 0.000074386596542485, 0.000075340270853546, 0.000076293945164470, 0.000077247619475256, 0.000078201293785901, 0.000079154968096403, 0.000080108642406762, 0.000081062316716975, 0.000082015991027041, 0.000082969665336957, 0.000083923339646722, 0.000084877013956335, 0.000085830688265794, 0.000086784362575096, 0.000087738036884240, 0.000088691711193225, 0.000089645385502049, 0.000090599059810709, 0.000091552734119205, 0.000092506408427534, 0.000093460082735695, 0.000094413757043685, 0.000095367431351504, 0.000096321105659150, 0.000097274779966620, 0.000098228454273914, 0.000099182128581029, 0.000100135802887963, 0.000101089477194715, 0.000102043151501284, 0.000102996825807666, 0.000103950500113862, 0.000104904174419868, 0.000105857848725683, 0.000106811523031306, 0.000107765197336735, 0.000108718871641968, 0.000109672545947002, 0.000110626220251838, 0.000111579894556472, 0.000112533568860903, 0.000113487243165130, 0.000114440917469150, 0.000115394591772962, 0.000116348266076563, 0.000117301940379954, 0.000118255614683131, 0.000119209288986093, 0.000120162963288838, 0.000121116637591364, 0.000122070311893670, 0.000123023986195754, 0.000123977660497615, 0.000124931334799249, 0.000125885009100657, 0.000126838683401835, 0.000127792357702783, 0.000128746032003499, 0.000129699706303980, 0.000130653380604225, 0.000131607054904233, 0.000132560729204001, 0.000133514403503528, 0.000134468077802812, 0.000135421752101852, 0.000136375426400645, 0.000137329100699191, 0.000138282774997486, 0.000139236449295530, 0.000140190123593321, 0.000141143797890856, 0.000142097472188135, 0.000143051146485156, 0.000144004820781916, 0.000144958495078414, 0.000145912169374649, 0.000146865843670618, 0.000147819517966320, 0.000148773192261753, 0.000149726866556916, 0.000150680540851806, 0.000151634215146422, 0.000152587889440762, 0.000153541563734825, 0.000154495238028608, 0.000155448912322111, 0.000156402586615330, 0.000157356260908265, 0.000158309935200914, 0.000159263609493275, 0.000160217283785347, 0.000161170958077126, 0.000162124632368613, 0.000163078306659805, 0.000164031980950700, 0.000164985655241297, 0.000165939329531593, 0.000166893003821588, 0.000167846678111279, 0.000168800352400665, 0.000169754026689744, 0.000170707700978514, 0.000171661375266974, 0.000172615049555121, 0.000173568723842954, 0.000174522398130472, 0.000175476072417672, 0.000176429746704553, 0.000177383420991113, 0.000178337095277351, 0.000179290769563264, 0.000180244443848850, 0.000181198118134109, 0.000182151792419039, 0.000183105466703637, 0.000184059140987902, 0.000185012815271832, 0.000185966489555426, 0.000186920163838681, 0.000187873838121597, 0.000188827512404170, 0.000189781186686400, 0.000190734860968285, 0.000191688535249823, 0.000192642209531013, 0.000193595883811852, 0.000194549558092338, 0.000195503232372471, 0.000196456906652249, 0.000197410580931669, 0.000198364255210729, 0.000199317929489429, 0.000200271603767767, 0.000201225278045740, 0.000202178952323347, 0.000203132626600587, 0.000204086300877456, 0.000205039975153955, 0.000205993649430081, 0.000206947323705832, 0.000207900997981206, 0.000208854672256203, 0.000209808346530819, 0.000210762020805054, 0.000211715695078905, 0.000212669369352372, 0.000213623043625451, 0.000214576717898142, 0.000215530392170443, 0.000216484066442351, 0.000217437740713866, 0.000218391414984985, 0.000219345089255708, 0.000220298763526031, 0.000221252437795953, 0.000222206112065473, 0.000223159786334588, 0.000224113460603298, 0.000225067134871600, 0.000226020809139493, 0.000226974483406974, 0.000227928157674043, 0.000228881831940697, 0.000229835506206935, 0.000230789180472755, 0.000231742854738155, 0.000232696529003133, 0.000233650203267688, 0.000234603877531818, 0.000235557551795521, 0.000236511226058796, 0.000237464900321641, 0.000238418574584054, 0.000239372248846033, 0.000240325923107576, 0.000241279597368683, 0.000242233271629350, 0.000243186945889577, },
        { 0.000000000000000000, 0.000000003725290298, 0.000000007450580597, 0.000000011175870895, 0.000000014901161194, 0.000000018626451492, 0.000000022351741791, 0.000000026077032089, 0.000000029802322388, 0.000000033527612686, 0.000000037252902985, 0.000000040978193283, 0.000000044703483582, 0.000000048428773880, 0.000000052154064178, 0.000000055879354477, },
    };
    #else
    constexpr auto step = not_exist;
    #endif

    constexpr f64 lutx[] = {
        0.785398163397448310, 1.107148717794090503, 1.325817663668032465, 1.446441332248135184, 1.508377516798939271, 1.539556493364628343, 1.555172598174419788, 1.562983985734795508, 1.566890096662929647, 1.568843204278417800, 1.569819764605337300, 1.570308045583701721, 1.570552186174747257, 1.570674256483002949, 1.570735291638722410, 1.570765809216781093, 1.570781068005835303, 1.570788697400365517, 1.570792512097631013, 1.570794419446263809, 1.570795373120580213, 1.570795849957738416, 1.570796088376317518, 1.570796207585607068, 1.570796267190251844, 1.570796296992574232, 1.570796311893735425, 1.570796319344316022, 1.570796323069606321, 1.570796324932251470, 1.570796325863574045, 1.570796326329235332, 1.570796326562065976, 1.570796326678481297, 1.570796326736688958, 1.570796326765792789, 1.570796326780344704, 1.570796326787620662, 1.570796326791258640, 1.570796326793077630, 1.570796326793987125, 1.570796326794441872, 1.570796326794669246, 1.570796326794782932, 1.570796326794839776, 1.570796326794868198, 1.570796326794882408, 1.570796326794889514, 1.570796326794893067, 1.570796326794894843, 1.570796326794895731, 1.570796326794896175, 1.570796326794896397, 1.570796326794896508, 1.570796326794896564, 1.570796326794896592, 1.570796326794896605, 1.570796326794896612, 1.570796326794896616, 1.570796326794896618, 1.570796326794896618, 1.570796326794896619, 1.570796326794896619, 1.570796326794896619, 
    };

    f64 atan(f64 x){
        if constexpr (step == not_exist){
            return ::atan(x);
        }
        else{
            auto is_neg             = (x < 0);

            if (is_neg){
                x                   = (-x);
            }

            auto i                  = (uxx)0;
            auto j                  = (uxx)0;
            auto shift              = (uxx)0;
            auto index              = (u64)0;
            auto r                  = (f64)0.0;
            auto v                  = (f64)0.0;
            auto m                  = (inc::mf64{x});
            auto minus              = (inc::mf64{x});
            auto end                = (m.bits_of_precision() + 1) / 2; // half 

            if (auto exp = m.real_exp(); exp >= 64){
                return is_neg ? -inc::pi / 2 : inc::pi / 2;
            }
            else if (m >= 1.0){
                r                  += (lutx[exp]);
                minus               = (inc::mf64{1}.real_exp(exp));
                m                   = (m - minus) / (1 + m * minus);
                minus               = (m);
            }

            while(true){
                if (i = (- m.real_exp_unsafe() - 1); i >= end){
                    break;
                }

                j                   = (i / step);
                shift               = (i % step + m.bits_of_precision() - step);
                index               = (m.real_dec_unsafe() >> shift);
                minus.decimal      &= (u64)-1 << shift;
                v                   = (lut[j][index]);
                r                  += (v);
                m                   = (m - minus) / (1 + m * minus);
                minus               = (m);
            }

            r                      += (m);
            return is_neg ? -r : r;
        }
    }
}

namespace mixc::math_asin::origin{
    constexpr auto step = not_exist;

    f64 asin(f64 x){
        if constexpr (step == not_exist){
            return ::asin(x);
        }
    }
}

namespace mixc::math_acos::origin{
    constexpr auto step = not_exist;

    f64 acos(f64 x){
        if constexpr (step == not_exist){
            return ::acos(x);
        }
    }
}

namespace mixc::math_cosh::origin{
    constexpr auto step = not_exist;

    f32 cosh(f32 x){
        if constexpr (step == not_exist){
            return ::cosh(x);
        }
    }

    f64 cosh(f64 x){
        if constexpr (step == not_exist){
            return ::cosh(x);
        }
    }
}

namespace mixc::math_sinh::origin{
    constexpr auto step = not_exist;

    f32 sinh(f32 x){
        if constexpr (step == not_exist){
            return ::sinh(x);
        }
    }

    f64 sinh(f64 x){
        if constexpr (step == not_exist){
            return ::sinh(x);
        }
    }
}

namespace mixc::math_tanh::origin{
    constexpr auto step = not_exist;

    f32 tanh(f32 x){
        if constexpr (step == not_exist){
            return ::tanh(x);
        }
    }

    f64 tanh(f64 x){
        if constexpr (step == not_exist){
            return ::tanh(x);
        }
    }
}
